<?php
session_start();
if(isset($_SESSION['valor']) && $_SESSION['valor'] && isset($_SESSION['rol']) && isset ($_SESSION["login"]) ){

require("../admin/conexion.php");

////BACKUP////////////////////
$eliminar="DROP TABLE `lista` ";
mysql_query($eliminar);

$crear="CREATE TABLE `lista` (
  `id` int(11) NOT NULL auto_increment,
  `producto_id` int(11) NOT NULL,
  `costo` float NOT NULL,
  `lista4` float NOT NULL,
  `lista2` float NOT NULL,
  `lista5` float NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;";
mysql_query($crear);

$resguardar="INSERT INTO lista SELECT * FROM listabackup"; 
mysql_query($resguardar);
/////////////////FIN DEL PADO 1//////////

echo "
<link href='../Scripts/styles.css' rel='stylesheet' type='text/css' />
<table width='90%' border='0' align='center' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='30' class='texto'>La Base de datos ha vuelto a su estado anterior!!!</td>
  </tr>
</table>
<br>
<table width='90%' border='0' align='center' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='30' background='../img/fondo1.jpg' class='link'>&nbsp;&nbsp;<a href='javascript:history.back();'>&lt;&lt; Volver</a></td>
  </tr>
</table>
";
 }else{ header ("Location: ../index.php?s=n");}?>